﻿
Public Class cParametrizacion
    Private lDrPara As dsGlobal.GLO_PARAMETRIZACIONRow
    Dim daClasi As dsGlobalTableAdapters.GLO_PARAMETRIZACIONTableAdapter
    Dim dtClasi As dsGlobal.GLO_PARAMETRIZACIONDataTable
    Public Sub New(ByVal CLAVE As String, ByVal IDCLASIFICA As String)
        Try
            daClasi = New dsGlobalTableAdapters.GLO_PARAMETRIZACIONTableAdapter
            dtClasi = daClasi.GetDataByClaveIdClasifica(CLAVE, IDCLASIFICA)
            If dtClasi.Rows.Count > 0 Then
                lDrPara = dtClasi.Rows(0)
            Else
                Throw New Exception("Falta crear item de Clasificación en tabla, verificar e intenter de nuevo")
            End If
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
    Public ReadOnly Property idClasificacion() As eClasificacion
        Get
            Return lDrPara.IDCLASIFICACION
        End Get
    End Property

    Public ReadOnly Property clave() As String
        Get
            Return lDrPara.CLAVE
        End Get

    End Property
    Public Property Valor() As Object
        Set(ByVal value As Object)
            lDrPara.VALOR = value
        End Set
        Get
            Return lDrPara.VALOR
        End Get
    End Property
    Public Sub Salvar()
        Try
            daClasi.Update(dtClasi)
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
End Class
